package com.api.devices.domain.vo.tree;

import com.api.common.config.ApiConfig;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
public class TreeVo {
    private Long ipcId;
    private String ipcName;
    private String ipcCode;
    private String monitoredCode;
    private String monitoredName;
    private String datCol;
    private String datColName;
    private String appLang;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    private Double startTimestamp;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    private Double endTimestamp;
    private int pageSize;
    private int pageNum;

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
        this.startTimestamp = (double) startTime.getTime();
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
        this.endTimestamp = (double) endTime.getTime();
    }

    public String getResourceTabName() {
        return ApiConfig.getTenant() + "_" + this.ipcCode + "_resource";
    }

    public String getIntergrationTabName() {
//        return ApiConfig.getTenant() + "_" + this.monitoredCode + "_tracing_intergration";
        return this.monitoredCode + "_tracing_intergration";
    }

    public String getEvaluationTabName() {
//        return ApiConfig.getTenant() + "_" + this.monitoredCode + "_tracing_evaluation";
                return this.monitoredCode + "_tracing_evaluation";
    }

    public String getSerializationTabName() {
//        return ApiConfig.getTenant() + "_" + this.monitoredCode + "_tracing_serialization";
        return this.monitoredCode + "_tracing_serialization";
    }
}
